<?php

namespace app\controllers\api;

use app\controllers\ApiController;
use app\models\TestModel;
use laiq\Exception;

class TestController extends ApiController
{
    public function index()
    {
        $params = $this->params;
        $arFail = ['status'=>'error', 'msg'=>'请求失败'];

        try{
            $mo = new TestModel();
            $mo->getList(['id'=>1]);

        } catch (Exception $e) {
            print_r($e->getMessage());
            exit;
        }


        $arRes = array('status'=>'ok', 'roles'=>['admin']);
        $this->json($arRes);
    }

}